import React, { useEffect } from "react";
import Mark from 'mark.js'
import './index.css'

export default function MarkPage() {
  
useEffect(()=>{
  var context = document.querySelector(".context");
  var instance = new Mark(context);
  instance.mark('测试',[null, {
    "acrossElements": true,
    "separateWordSearch": false,
}]);
},[])
  return <div className="context">
    123
    <span>测试</span>

    12321344
    测<span>试123</span>
    <span>测</span><span>试</span>
  </div>
}